<template>
  <div id="app">
    <div class="main">

    
     
      <!-- 路由视图 -->
       <router-view :iconplay="iconplay" :player-id="playerId" @get-player-id="getPlayerId" @get-play-all-id="getPlayAllId"></router-view>
     
     

     <!-- 播放器组件 -->
     <player v-show="playerId" :player-id="playerId" :list-id="listId" @set-player-id="setPlayerId" @animationFun="iconplay=$event"></player>

    </div>
  </div>
</template>

<script>
import player from "./components/base/player.vue"
export default {
   data(){
     return{
       playerId:null,
       listId:null,
       iconplay:false,
     }
   },
   methods:{
        
    //  获取子组件播放歌曲id
     getPlayerId(id){
       console.log("歌曲id",id);
       this.playerId = id
     },
     getPlayAllId(id){
       this.listId = id
     },
     setPlayerId(id){
       this.playerId = id
     }
   },
   components:{
     player
   }
};
</script>

<style lang="less">
@import "./assets/css/base.css";


</style>